package uteis;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class FormatsParametro {

	public static String CatchData() {

		// SimpleDateFormat sdfDate = new SimpleDateFormat("MM/dd/yyyy",
		// Locale.US);
		// String dtalt = PLCParametro.CatchData();
		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy/MM/dd", Locale.US);
		String data = sdfDate.format(new Date(System.currentTimeMillis()));
		return data;

	}

	// ///////////////////////////////////////////////////////////////
	// Pega hora do Sistema //
	// ///////////////////////////////////////////////////////////////

	public static String CatchHora() {

		SimpleDateFormat sdfTime = new SimpleDateFormat("HH:mm:ss", Locale.US);
		String time = sdfTime.format(new Date(System.currentTimeMillis()));
		return time;

	}

	// ///////////////////////////////////////////////////////////////
	// Busca CIDADES //
	// ///////////////////////////////////////////////////////////////
	/**
	 * static public org.primefaces.json.JSONArray RecebeCidades(){
	 * 
	 * String result = null; String response = null;
	 * 
	 * try{
	 * 
	 * ArrayList<NameValuePair> postParameters = new ArrayList<NameValuePair>();
	 * 
	 * 
	 * 
	 * response = CustomHttpClient.executeHttpPost(
	 * "http://192.168.2.100:8080/enviaproduto.php", postParameters); result =
	 * response.toString();
	 * 
	 * }catch(Exception e){ Long.e("log_tag",
	 * "Error in http connection"+e.toString()); //return "Erro ao conectar"; }
	 * 
	 * 
	 * //paring data org.primefaces.json.JSONArray jArray = null;
	 * 
	 * try{ jArray = new org.primefaces.json.JSONArray(result);
	 **/

	/**
	 * JSONObject json_data=null; for(int i=0;i<jArray.length();i++){ json_data
	 * = jArray.getJSONObject(i); }
	 **/
	/**
	 * }catch(JSONException e1){ //Toast.makeText(getBaseContext(),
	 * "No Food Found", Toast.LENGTH_LONG).show(); //return
	 * "Dados cliente vazia"; }catch (ParseException e1){ e1.printStackTrace();
	 * //return "erro na execucao"; }
	 * 
	 * return jArray;
	 * 
	 * }
	 **/

}
